/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * main.java
 *
 * Created on 08-ene-2012, 14:07:30
 */

package colegio_inftel;

import es.uma.masterinftel.colegio_inftel.vistas.AnotarNotasVista;
import es.uma.masterinftel.colegio_inftel.control.AnotarNotasControlador;
import es.uma.masterinftel.colegio_inftel.modelo.dao.CalificacionesDAO;

/**
 *
 * @author agumpg
 */
public class main extends javax.swing.JFrame {

    public CalificacionesDAO        modelo;
    public AnotarNotasVista         vista;
    public AnotarNotasControlador   controlador;

    /** Creates new form main */
    public main() {

        //modelo = new AnotarNotasModelo();
        modelo = new CalificacionesDAO();
        vista = new AnotarNotasVista(modelo, this, true);
        controlador = new AnotarNotasControlador(modelo,vista);

        this.setLocationRelativeTo(null);

        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jButton1.setText("calificaciones");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setText("Prueba label");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap(133, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(jButton1)
                        .addGap(133, 133, 133))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(jButton2)
                        .addGap(147, 147, 147))))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(139, Short.MAX_VALUE)
                .addComponent(jButton1)
                .addGap(28, 28, 28)
                .addComponent(jButton2)
                .addGap(75, 75, 75))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:

        vista.setAnio_mat(2007);
        vista.setId_alumno(31);
        vista.setCodasignatura(1);

        vista.setAlumno("Manuel Valls");
        vista.setGrupo("B");
        vista.setAsignatura("Química");
        vista.setCurso("1º de ESO");
        vista.setNota1("5.0");
        vista.setNota2("5.0");
        vista.setNota3("5.0");
        vista.setNotaFinal("5.0");
        vista.setVisible(true);

    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        // TODO add your handling code here:
        vista.setAnio_mat(2007);
        vista.setId_alumno(31);
        vista.setCodasignatura(2);

        vista.setAlumno("Agustín Pereña");
        vista.setGrupo("A");
        vista.setAsignatura("Física");
        vista.setCurso("2º de ESO");
        vista.setNota1("6.0");
        vista.setNota2("6.0");
        vista.setNota3("6.0");
        vista.setNotaFinal("6.0");
        vista.setVisible(true);

    }//GEN-LAST:event_jButton2ActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
   
                new main().setVisible(true);

            }
        });
    }







    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    // End of variables declaration//GEN-END:variables

}
